/*
 * Copyright (c) 2024. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
 * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
 * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
 * Vestibulum commodo. Ut rhoncus gravida arcu.
 */

package com.huawei.csi.tool.domain.score;

import javafx.scene.control.TreeItem;

/**
 * 静态扫描 （20）
 *
 * @author lxw
 */
public class StaticScanScore extends AbstractScore {
    /**
     * 代码没有错误、警告或格式问题 （20）
     */
    private int staticScanScore = 20;

    public StaticScanScore() {
        super.beforeScore = staticScanScore;
    }

    @Override
    public int beforeVerifyScore() {
        return super.beforeScore;
    }

    @Override
    public int afterVerifyScore() {
        return staticScanScore;
    }

    @Override
    @SuppressWarnings("all")
    public TreeItem<String> treeItem() {
        TreeItem<String> root = new TreeItem<>("静态扫描（" + afterVerifyScore() + "/" + beforeScore + ")");
        TreeItem<String> staticScanItem = new TreeItem<>(staticScanScore + "/" + 20 + " 代码没有错误、警告、或格式问题");
        root.getChildren().add(staticScanItem);
        return root;
    }

    public int getStaticScanScore() {
        return staticScanScore;
    }

    public void setStaticScanScore(int staticScanScore) {
        this.staticScanScore = staticScanScore;
    }
}
